import permission from './permission'
import { createRouter, createWebHistory } from 'vue-router'

const routes = [
  {
    path: '/login',
    title: '登录',
    name: 'login',
    component: () => import('@/views/login/index'),
  },
  {
    path: '/404',
    name: '404',
    component: () => import('@/views/exception/404'),
  },
  {
    path: '/:pathMatch(.*)*',
    component: () => import('@/views/exception/404'),
  }
]

const router = createRouter({
  routes,
  history: createWebHistory(import.meta.env.BASE_URL)
})

permission(router)

export default router
